<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use \think\Route;
//兼容模式 不支持伪静态可开启
Route::group('thirdpart', function () {
    Route::rule('/xiumi/image/upload$', 'thirdpart/Xiumi/image_upload', 'post');
    Route::rule('/xiumi/html/api$', 'thirdpart/Xiumi/html_api', 'post');
    Route::rule('/xiumi/notify/index$', 'thirdpart/Xiumi/notify_index', 'get');
    Route::miss(function(){
        return json_encode([
            'code' => 404,
            'msg'  => '不存在的请求'
        ]);
    });
});



Route::get("test",function(){
    // $enroll=SchoolEnroll::order("id","desc")->find();
    // SchoolEnroll::paySuccess($enroll->seq_no,"11111");
});
//验证微信公众号域名
// Route::get('/', function () {
//     $signature = input('signature');
//     $timestamp = input('timestamp');
//     $nonce = input('nonce');
//     $echostr = input('echostr');
//     $token = "4f17e5e8dc5705da4faa2adef70862fd";
//     think\Log::debug(input());
//     $list = [$token, $timestamp, $nonce];
//     sort($list);
//     $hashcode = sha1(implode("", $list));
//     think\Log::debug("hashcode:" . $hashcode);
//     think\Log::debug("signature:" . $signature);
//     if ($signature == $hashcode) {
//         return $echostr;
//     } else {
//         return "";
//     }
// });
